//
//  APPUserDefault.swift
//  Lease_IOS
//
//  Created by Mr.wang on 2019/4/29.
//  Copyright © 2018 Mr.wang. All rights reserved.
//     __            __            __
//     \ \          /  \          / /     帅™
//      \ \        / /\ \        / /
//       \ \      / /  \ \      / /
//        \ \    / /    \ \    / /
//         \ \  / /      \ \  / /
//          \ \/ /        \ \/ /
//           \__/          \__/


import HandyJSON

struct APPUserDefault: HandyJSON {
    
    var lastLaunchVersion = ""
    var isDevelopMode = false
    var developModeUrl = ""
    var lastLoginEmail = ""
    var lastLaunchTime: Double = 0
    var userSelectLanguage: UserSelectLanguage? = nil
}

enum UserSelectLanguage: String, HandyJSONEnum {
    case chinese = "0"
    case english = "1"
    case de = "2"
    case vi = "3"
}

extension UserSelectLanguage {
    
    var header: String {
        switch self {
        case .chinese: return "zh"
        case .english: return "de"
        case .de: return "de"
        case .vi: return "vi"
        }
    }
    
    var text: String {
        switch self {
        case .chinese: return "简体中文"
        case .english: return "English"
        case .de: return "Deutsch"
        case .vi: return "Tiếng Việt"
        }
    }
}
